import {
  IFormDetailContainerController,
  IFormDetailProvider,
} from '@ibiz-template/runtime';
import { IDEFormMDCtrl } from '@ibiz/model-core';
import { FormController } from '../../form/form.controller';
import { FormMDCtrlController } from './form-mdctrl.controller';
/**
 * 表单多数据部件适配器
 *
 * @author lxm
 * @date 2022-09-19 22:09:03
 * @export
 * @class FormMDCtrlProvider
 * @implements {EditorProvider}
 */
export class FormMDCtrlProvider implements IFormDetailProvider {
  component: string = 'IBizFormMDCtrl';

  async createController(
    detailModel: IDEFormMDCtrl,
    form: FormController,
    parent: IFormDetailContainerController | undefined,
  ): Promise<FormMDCtrlController> {
    const c = new FormMDCtrlController(detailModel, form, parent);
    await c.init();
    return c;
  }
}
